#apollo版本,为了方便已经把包下载在本地
APOLLO_VERSION=0.11.0

#解压
tar -xzf apollo-$APOLLO_VERSION.tar.gz

#修改admin-server配置
cp ./admin-server/{application.yml,bootstrap.yml,logback.xml} ./apollo-$APOLLO_VERSION/apollo-adminservice/src/main/resources/

#修改config-server配置文件
cp ./config-server/{application.yml,bootstrap.yml,logback.xml} ./apollo-$APOLLO_VERSION/apollo-configservice/src/main/resources/

#修改portal-server配置文件
cp ./portal-server/{application.yml,application-ctrip.yml,logback.xml} ./apollo-$APOLLO_VERSION/apollo-portal/src/main/resources/
cp ./portal-server/apollo-env.properties ./apollo-$APOLLO_VERSION/apollo-portal/src/main/config/

#mvn打包
mvn -f ./apollo-$APOLLO_VERSION/pom.xml clean package -Dmaven.test.skip=true

#移动到对应的Dockerfile文件内
cp ./apollo-$APOLLO_VERSION/apollo-adminservice/target/apollo-adminservice-$APOLLO_VERSION.jar ./admin-server
cp ./apollo-$APOLLO_VERSION/apollo-configservice/target/apollo-configservice-$APOLLO_VERSION.jar ./config-server
cp ./apollo-$APOLLO_VERSION/apollo-portal/target/apollo-portal-$APOLLO_VERSION.jar ./portal-server

docker-compose  up --build -d